-
Notifications
You must be signed in to change notification settings - Fork 92
New Compounding Staking Strategy post Pectra upgrade #2559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
naddison36
wants to merge
434
commits into
master
Choose a base branch
from
nicka/pectra
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2559 +/- ##
==========================================
+ Coverage 35.37% 40.07% +4.69%
==========================================
Files 112 122 +10
Lines 5331 5744 +413
Branches 1412 1526 +114
==========================================
+ Hits 1886 2302 +416
+ Misses 3444 3440 -4
- Partials 1 2 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
DanielVF
reviewed
Jul 1, 2025
contracts/contracts/strategies/NativeStaking/CompoundingValidatorManager.sol
Outdated
Show resolved
Hide resolved
DanielVF
reviewed
Jul 1, 2025
contracts/contracts/strategies/NativeStaking/CompoundingValidatorManager.sol
Outdated
Show resolved
Hide resolved
DanielVF
reviewed
Jul 2, 2025
contracts/contracts/strategies/NativeStaking/CompoundingStakingSSVStrategy.sol
Show resolved
Hide resolved
clement-ux
reviewed
Jul 9, 2025
contracts/contracts/strategies/NativeStaking/CompoundingStakingSSVStrategy.sol
Show resolved
Hide resolved
clement-ux
reviewed
Jul 9, 2025
contracts/contracts/strategies/NativeStaking/CompoundingStakingSSVStrategy.sol
Outdated
Show resolved
Hide resolved
contracts/contracts/strategies/NativeStaking/CompoundingStakingSSVStrategy.sol
Outdated
Show resolved
Hide resolved
clement-ux
reviewed
Jul 10, 2025
contracts/contracts/strategies/NativeStaking/CompoundingStakingSSVStrategy.sol
Show resolved
Hide resolved
clement-ux
reviewed
Jul 15, 2025
contracts/contracts/strategies/NativeStaking/CompoundingValidatorManager.sol
Outdated
Show resolved
Hide resolved
contracts/contracts/strategies/NativeStaking/CompoundingValidatorManager.sol
Outdated
Show resolved
Hide resolved
contracts/contracts/strategies/NativeStaking/CompoundingValidatorManager.sol
Outdated
Show resolved
Hide resolved
clement-ux
reviewed
Jul 15, 2025
contracts/contracts/strategies/NativeStaking/CompoundingValidatorManager.sol
Show resolved
Hide resolved
DanielVF
reviewed
Jul 18, 2025
contracts/contracts/strategies/NativeStaking/CompoundingValidatorManager.sol
Outdated
Show resolved
Hide resolved
DanielVF
reviewed
Jul 18, 2025
contracts/contracts/strategies/NativeStaking/CompoundingValidatorManager.sol
Outdated
Show resolved
Hide resolved
DanielVF
reviewed
Jul 18, 2025
contracts/contracts/strategies/NativeStaking/CompoundingValidatorManager.sol
Show resolved
Hide resolved
DanielVF
reviewed
Jul 18, 2025
contracts/contracts/strategies/NativeStaking/CompoundingValidatorManager.sol
Show resolved
Hide resolved
Improved output of verifyBalances HH task
Add more validator proofs to the unit tests
* add MockBeaconRoots on hoodi to reflect the state on meinnet * add support to verify Slot on hoodi
DanielVF
reviewed
Jul 23, 2025
contracts/contracts/strategies/NativeStaking/ValidatorRegistrator.sol
Outdated
Show resolved
Hide resolved
DanielVF
reviewed
Jul 23, 2025
contracts/contracts/strategies/NativeStaking/CompoundingValidatorManager.sol
Outdated
Show resolved
Hide resolved
* Allow a validator full exit when it is already exiting * Updated validator state diagram
Co-authored-by: Domen Grabec <[email protected]>
…if the validator has a zero balance (#2671)
* Restricted the pending deposit index to uint32 as the pending deposits container height is only 28 * Added check that pendingDepositIndex is < 2**27 in verifyPendingDeposit
…sit queue is empty (#2669) * Can verify a deposit if the validator is exiting and the pending deposit queue is empty * add comment --------- Co-authored-by: Domen Grabec <[email protected]>
…#2673) * Allow verification of a non 0x02 validator so it can be marked as INVALID * Added unit test for verifying an invalid validator type * pass withdrawal credentials when verifying validator (#2674) * Fixed verifyValidator Hardhat task * Fixed beacon proof fork test --------- Co-authored-by: Domen Grabec <[email protected]>
* Allow withdraws from the staking strategy by the Registrator for automation * Added signMessage HH task for Etherscan ownership verification * Deployed latest strategy contract to Hoodi * Added autoValidatorWithdrawals Hardhat task * Fixed unit tests * Changed execute option to dryrun * Created reusable totalPartialWithdrawals function Fixed summing of partial withdrawal amount as its in Gwei
* Revert upgrading the old native staking strategies * Restored old Hardhat tasks to bulk exit and remove validators from the old native staking strategies
* Added autoValidatorDeposits Hardhat task * Set the new staking strategy as the default for the OETH Vault * Refactor auto deposit
* Fix auto deposits to include pending deposits * Increased MAX_DEPOSITS from 12 to 32 Deployed latest strategy contract to Hoodi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A new staking strategy that uses merkle proofs to verify the operations of validators running on the beacon chain.
Objectives
Links
Relevant Pectra Release changes
Contracts
The scope of the contracts of this build is
CompoundingStakingSSVStrategy
is the new staking contract.CompoundingValidatorManager
is inherited byCompoundingStakingSSVStrategy
CompoundingStakingStrategyView
has two view functions forCompoundingStakingSSVStrategy
BeaconProofs
called fromCompoundingValidatorManager
The following libraries have also be built
BeaconRoots
BeaconProofsLib
PartialWithdrawal
Merkle
Endian
Hoodi
States
Beacon chain data
Beacon Container Specs
To get the consolidate beacon chain specification for the last Pectra release
build/lib/eth2spec/electra/mainnet.py
will have the full, consolidated changes. This includes all the beacon chain container definitions. eg BeaconBlock, BeaconBlockBody, BeaconState, Validator...Processes
Register a SSV validator
Initial deposit to a new validator
Deposit more to existing validator
Verify validator
Verify deposit to validator
Update strategy balances
Withdrawals
Admin
Build
Keeping the contract under 24Kb has been a problem during development. The following will show the contract size of the compile contracts including
CompoundingStakingSSVStrategy
.export CONTRACT_SIZE=true npx hardhat compile
Testing
Unit Tests
Are main strategy unit tests in
contracts/test/strategies/compoundingSSVStaking.js
There are also unit tests of the beacon merkle proofs in
contracts/test/beacon/beaconProofs.js
yarn test
Fork Tests
There are no fork tests of the strategy as its hard to mock the beacon chain. But there are fork tests of various beacon chain contracts and libraries. These includes:
Hoodi Testnet
Hoodi faucet: https://hoodi-faucet.pk910.de/
SSV faucet: https://faucet.ssv.network/
Contracts have been deployed to Hoodi with deployment scripts in
contracts/deploy/hoodi
export DEPLOYER_PK= yarn run deploy:hoodi npx hardhat etherscan-verify --network hoodi --api-url https://api-hoodi.etherscan.io
Hoodi testing using Hardhat tasks
Deployment
Hoodi
Code Change Checklist
To be completed before internal review begins:
Internal review: